1. Field of the Invention
This invention relates to a data processing system having virtual memory and more particularly to such a system and the method employed therein for varying the program window size in main memory for each program being processed by the system.
2. Description of Prior Art
A hierarchical memory system may be formed which employs a high-access-speed low-capacity memory as a main memory and a low-access-speed high-capacity memory as a secondary store. The main memory once was a core memory and now is usually an integrated circuit memory. The secondary store or memory may also be a core memory, a disk memory, or a magnetic bubble memory and the like. The purpose of the main memory is to provide appropriate transfer rates to and from a processing module with data and other information being transferred from the secondary store or memory to the main memory as required. A virtual memory system may be created by providing a hierarchical memory system with the ability to automatically transfer requested information from the secondary store to main memory when that information does not reside in main memory at the time of its request. In this manner, the user is not aware of any inherent limitations due to the size of the main memory.
The advantage of a virtual storage implementation is that not all of the stored information, either program or data, needed for the progress of the computation is required to be stored in main memory simultaneously, but that for large periods of time, parts of the stored information may reside in the secondary store. For this purpose, the information is partitioned into a number of segments such that, during the progress of the computation, the information of a segment will either be totally present in, or totally absent from, the main or primary store. If all the segments have the same size, they are generally referred to as pages, in which case the primary store is then subdivided into so-called page frames which are units of the store able to contain exactly one page.
In a virtual memory system, demand paging is provided so that computation can proceed at its full rate until an access to an absent page is required. Such a requirement is called a page fault and the computation causing the page fault is halted until the needed page can be brought into the primary store from the secondary store. As new pages are brought into the primary store, other pages, already present in the primary store when the page fault occurred, must be sent back to the secondary store in order to make room for new pages. The number of pages or page frames provided in primary store for any given program is defined for the purpose of the present invention as the program window size.
Different programs, different processes within a given program, or even the same process with different data may require different program window sizes. Some processes may require a few number of instructions which are often recalled and other processes may require long strings of instructions. Some processes may require rather small amounts of data for a time while other processes may require large amounts of data at a given time. If a single program window size were provided for all processes of the program, some processes would have lesser throughput than others due to a large number of page faults each requiring that the process be halted until the new pages were brought into the primary store. Thus, a varying program window size should be provided to optimize processing throughput.
In a typical virtual storage implementation, a data transfer channel is provided to transfer pages between the secondary and primary stores and, during the computation time for a given process, the channel and the processor compete for access to the primary store in an interleaved manner. When a page fault occurs during a given process, the processor module is halted until the new page can be brought in. This results in a certain amount of inactivity for the processor module. However, should a given process encounter a relatively small number of page faults, then the processor module would be operating most of the time while the data transfer channel would be idle much of the time. Therefore, in order to utilize both the processor and the channel as much as possible, it would be desirable to adjust the program window size so there would be just enough page fault occurrences such that, during a given portion of process running time, the data channel transfer time would be equal to the processor's computational time. In a multiprogramming mode, the processor would be free to turn to a separate program or process while the channel is bringing in new pages in response to a page fault for the current program. Similarly, the data channel would be occupied with transferring pages for other processes while the processing module is active with a given process not having an abnormally high number of page faults.
It is, then, an object of the present invention to provide a data processing system having an improved virtual storage system.
It is another object of the present invention to provide a data processing system with virtual memory system wherein the program window size for various programs can be varied to minimize an unduly large number of page faults.
It is still another object of the present invention to provide a data processing system with a virtual memory system wherein the number of occurrences of page faults can be adjusted to optimize both the processor's computational time and the data channel's transfer time so as to improve the flexibility of scheduling and the throughput of the data processing system.